<template>
  <div class="userlist_wrap">
    <ul>
      <li
        class="with-grey-bottom-border"
        v-for="item in list"
        :key="item.id"
        @click="
          $router.push({
            path: '/income-item-detail',
            query: { id: item.id }
          })
        "
      >
        <div v-if="Object.keys(item.user).length > 0" class="userlist_lt">
          <img :src="item.user.avatar" alt="" />
          <div class="userlistInfoWrap">
            <p class="userlist_name">{{ item.user.nickname }}</p>
            <!-- <p class="userlist_type">{{ item.user.name }}</p> -->
          </div>
        </div>
        <div class="userlist_rt">
          <p class="userlist_money">￥{{ item.bonus }}</p>
          <p class="userlist_time">{{ item.created_at }}</p>
        </div>
        <div class="clear"></div>
      </li>
    </ul>
  </div>
</template>

<script>
export default {
  props: ["list"],
  data() {
    return {};
  }
};
</script>

<style lang="less" scoped>
.clear {
  clear: both;
}

.userlist_wrap {
  li {
    padding: 0.5rem 3.2%;
    background: #ffffff;
    border-bottom: 1px solid #eeeeee;
  }

  li:last-child {
    border: none;
  }

  .userlist_lt {
    float: left;
    // width: 40%;

    img {
      width: 1.6rem;
      height: 1.6rem;
      border-radius: 50%;
      vertical-align: middle;
    }

    .userlistInfoWrap {
      display: inline-block;
      margin-left: 0.4rem;
      text-align: center;

      .userlist_name {
        color: #444444;
        font-size: 0.64rem;
        // margin-bottom: 0.3rem;
        vertical-align: middle;
      }

      .userlist_type {
        color: #0078ff;
        font-size: 0.52rem;
        text-align: center;
        padding: 0 0.24rem;
        height: 0.8rem;
        line-height: 0.8rem;
        border-radius: 0.4rem;
        border: 1px solid #0078ff;
      }
    }
  }

  .userlist_rt {
    float: right;

    .userlist_money {
      color: #f85859;
      font-size: 0.56rem;
      text-align: right;
      margin-bottom: 0.45rem;
    }

    .userlist_time {
      text-align: right;
      color: #999999;
      font-size: 0.48rem;
    }
  }
}
</style>